package reflect;

import java.util.Arrays;

public class ArgDemo {
    public static void main(String[] args) {
                /*
            为变长参数传参时会被编译器统一改为数组
            doSome();->doSome(new String[]{})
            doSome("a");->doSome(new String[]{"a"})
            doSome("a","b");->doSome(new String[]{"a","b"})
         */
        doSome();
        doSome("a");
        doSome("a","b");
        doSome("a","b","c");
        doSome("a","b","c","d");
        doSome("a","b","c","d","b","c","d","b","c","d","b","c","d","b","c","d");


    }
    public static void doSome(String... arg){
        System.out.println(arg.length);
        System.out.println(Arrays.toString(arg));
    }
}
